/*
 * @Date: 2022-03-02 17:55:01
 * @LastEditors: 春贰
 * @gitee: https://gitee.com/chun22222222
 * @github: https://github.com/chun222
 * @Desc:
 * @LastEditTime: 2022-03-22 10:02:52
 * @FilePath: \server\system\router\autocode.go
 */
package router

import (
	"go2admin_pure/system/controller/autocode"
	"go2admin_pure/system/core/config"
	"go2admin_pure/system/middleware"
	"github.com/gin-gonic/gin"
)

func AutocodeRouter(r *gin.Engine) {
	//dev模式下才能生成代码！
	if env := config.Instance().App.Env; env == "dev" {
		authG := r.Group("autocode")
		authG.Use(middleware.JwtMid())
		{
			authG.POST("/create", autocode.Create)
			authG.POST("/remove", autocode.Remove)
			authG.POST("/tablelist", autocode.TableList)
			authG.POST("/tablefields", autocode.ColumnList)
			authG.POST("/permissiondir", autocode.PermissionDir)

		}
	}
}
